package config

import (
	"learn/smart/util/redis"
)

type User struct {
	Username     string
	Password     string
	PayPassword  string
	CSRFToken    string
	SessionId    string
	OpenSell     bool
	OpenPurchase bool
}

//获取代理服务器列表
const SaveName = "proxies"

func GetProxies() []string {
	client := redis.GetClient()
	m, err := client.HGetAll(SaveName).Result()
	var s []string
	if err != nil {
		return s
	}

	for k := range m {
		s = append(s, k)
	}
	return s
}

//是否开启代理服务器
func OpenProxy() bool {
	return true
}

func GetIUsers() []User {
	return []User{
		{
			Username:    "abc64479578",
			Password:    "abc9798574748",
			PayPassword: "679578",
			OpenSell:    true,
		},
		{
			Username:    "lic666",
			Password:    "linzi328928",
			PayPassword: "328928",
			OpenSell:    true,
		},
		{
			Username:    "Chris3luna",
			Password:    "xdf64476503",
			PayPassword: "530135",
			OpenSell:    true,
		},
	}
}

func GetCUsers() []User {
	return []User{
		{
			Username: "18268931664",
			Password: "abc9798574748",
			OpenSell: true,
		},
	}
}

func GetOpenC5gameUrl() string {
	return "https://open.c5game.com"
}

func GetMedianRate() float64 {
	return 0.8
}
